import { ExecutionContext, createParamDecorator } from '@nestjs/common';

export default createParamDecorator(
  (key = 'accessToken', ctx: ExecutionContext) => {
    const req = ctx.switchToHttp().getRequest();
    return req[key];
  },
);
